|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Macros | |
| #define | SLAVE_ADDRESS 0x48 |
Functions | |
| void | main (void) |
| void | USCIB0_ISR (void) |
Variables | |
| uint8_t | TXData =0 |
| uint8_t | TXByteCtr |
| #define SLAVE_ADDRESS 0x48 |
This example shows how to configure the I2C module as a master for multi byte transmission in interrupt driven mode. The address of the slave module is set in this example.
MSP430FR57xx Demo - USCI_B0 I2C Master TX multiple bytes to MSP430 Slave
Description: This demo connects two MSP430's via the I2C bus. The master transmits to the slave. This is the MASTER CODE. It cntinuously transmits an array of data and demonstrates how to implement an I2C master transmitter sending multiple bytes using the USCI_B0 TX interrupt. ACLK = n/a, MCLK = SMCLK = BRCLK = default DCO = ~1.045MHz
/|\ /|\
MSP430FR5739 10k 10k MSP430FR5739
slave | | master
----------------- | | -----------------
-|XIN P1.6/UCB0SDA|<-|----+->|P1.6/UCB0SDA XIN|-
| | | | |
-|XOUT | | | XOUT|-
| P1.7/UCB0SCL|<-+------>|P1.7/UCB0SCL |
| | | |
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 82 of file eusci_b_i2c_ex3_masterTxMultiple.c.
| void main | ( | void | ) |
Definition at line 87 of file eusci_b_i2c_ex3_masterTxMultiple.c.
References __delay_cycles(), param, SLAVE_ADDRESS, TXByteCtr, and TXData.
| void USCIB0_ISR | ( | void | ) |
Definition at line 177 of file eusci_b_i2c_ex3_masterTxMultiple.c.
References __bic_SR_register_on_exit(), TXByteCtr, and TXData.
| uint8_t TXByteCtr |
Definition at line 85 of file eusci_b_i2c_ex3_masterTxMultiple.c.
| uint8_t TXData =0 |
Definition at line 84 of file eusci_b_i2c_ex3_masterTxMultiple.c.